package com.cn.common;

import io.netty.channel.ChannelHandlerContext;

import java.util.HashMap;

public class BrokerAppStore {

    private static HashMap<ChannelHandlerContext /**client**/, BrokerEntity> map = new HashMap<>();

    public static void put(ChannelHandlerContext ctx, BrokerEntity broker) {
        map.put(ctx, broker);
    }

    public static BrokerEntity get(ChannelHandlerContext ctx) {
        return map.get(ctx);
    }

    public static void del(ChannelHandlerContext ctx) {
        map.remove(ctx);
    }

    public static void clean() {
        map.clear();
    }

}
